package com.shen.pojo.candle;

/**
 * Author:shen
 * CreateDate:2020/4/29.
 * Function:
 */
public class Candle {
    private String color;//颜色
    private int len;//长度

    public Candle() {
    }

    public Candle(String color, int len) {
        this.color = color;
        this.len = len;
    }
    public void burn(){
        if(this.len>0){
            while (len>=0){

                if(len==0){
                    System.out.println("蜡烛烧完了");
                }else{
                    System.out.println("蜡烛的长度为"+len);
                }
                len--;
            }
        }else{
            System.out.println("蜡烛烧完了");
        }
    }
}
